﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="../style.css">
<link href="../tablecloth/tablecloth.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="../tablecloth/tablecloth.js"></script>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>

<?php	

	include("../inc/joomlaInt_admin.php");
	include("../inc/inc_configuration.php");
	
	if ($jUser==0)
	{
		echo "Bitte zuerst einloggen!";
	}
	else
	{
	
		$gruppe=$_GET["gruppe"];
		
		$liga=$_SESSION["liga"];
		
		$q="SELECT type FROM $tbl_leagues WHERE id=$liga";
		$qe=mysql_query($q);
		$qeo=mysql_fetch_object($qe);
		
		$type=$qeo->type;
		
		echo "<table>
				<tr>
					<td>
						<table>
							";
							if ($type==2)
							{
								echo"<tr>
										<td>
											<center>
											<form action='gruppe_spielplan_erstellen.php' method='post'>
												<input type='hidden' name='gruppe' value='$gruppe'>
												<input type='submit' value='Spielplan erstellen' class='button anlegen'>
											</form>
											</center>
										</td>
									</tr>";
							}
			
			echo "<tr><td><a href='spieltage_freigeben_v.php?gruppe=$gruppe&ref=1' class='button freigeben'>Spiele freigeben</a></td></tr>";
			
			echo "<tr><td><a href='gruppenspiele.php?gruppe=$gruppe' class='button freigeben'>Gruppenspiele</a></td></tr>";
			
			echo "<tr><td><a href='spiele_entfernen.php?liga=$liga&gruppe=$gruppe' class='button entfernen'>Alle Spiele löschen</a></td></tr>";
			echo "<tr><td><a href='liga_international.php?liga=$liga' class='button zurueck'>Zurück</a></td></tr></table></td>";
		
		
		
		echo "	<td>
				<table>
				<tr>
					<th>id</th>
					<th></th>
					<th>name</th>
					<th>Rating</th>
					<th>L</th>
				</tr>
				";
			
		$q = "	SELECT 
					gt.id AS id,
					t.id AS tId,
					t.name AS name,
					t.rating AS rating
				FROM
					$tbl_gt gt,
					$tbl_teams t
				WHERE
					gt.teamId=t.id AND
					gt.groupId=$gruppe";
					
		$qe = mysql_query($q);
		
		while ($row=mysql_fetch_object($qe))
		{
			echo "	<tr>
						<td>",$row->id,"</td>
						<td><a href='../team_kader.php?team=",$row->tId,"'><img src='../$logopath",$row->tId,".png' width='$teamlogo_s_size' height='$teamlogo_s_size' alt=''></a></td>
						<td><a href='../team_kader.php?team=",$row->tId,"'>",$row->name,"</a></td>
						<td>",$row->rating,"</td>
						<td><a href='gruppe_team_entfernen.php?gruppe=$gruppe&team=",$row->tId,"' class='minibutton entfernen'></a></td></tr>
						";
		
		}
		
		echo"	<tr>
					<th colspan='5'></th>
				</tr>
			</table><br><br>";
		
		
		echo "<form action='gruppe_team_hinzufuegen.php' method='post'>";
		
			$abfrage = "SELECT * FROM $tbl_teams ORDER BY name"; 
			$ergebnis = mysql_query($abfrage);
			
			echo '	<table class="nb">
						<tr>
							<td>Team hinzufügen:</td>
							<td><select name="team" Size="1">';
			
			while ($row = mysql_fetch_object($ergebnis))
				{
					echo '<Option Value="',$row->id,'">' ,$row->name, '</option>';
				}
				
			echo"	</select></td></tr>
					<tr><td><input hidden type='text' size='17' name='gruppe' value='",$gruppe,"'></td>
					<td><input type='submit' class='button anlegen' value='Hinzufügen'></td></tr></table>
					</form></td><tr>
					</table>";
					
		
	}
	



?>

</body>
</html>